import request from "./request";
// 获取轮播图

export const getBannerList = () => request.get("/banners");

//获取作者作品页
export const getAuthorList = () => request.get("/author");

//获取首页天下酒鬼
export const getHomeList = () => request.get("/home_jiugui");
//获取首页无世界阅读
export const getReadList = () => request.get("/home_new");

//获取首页我们都是孩子
export const getHaiList = () => request.get("/home_book");

// 获取电子书第一部分数据
export const getEbook_head = () => request.get("/ebookHead");

// 获取电子书新驻作家数据
export const getEbook_author = () => request.get("/home_list");

// 获取电子书 -一种青春- 数据（全部页面数据也用了）
export const getYouth = () => request.get("/ebook_list");

//获取电子书 仅有文本内容的详情
export const getTextDetail = (id: any) =>
  request.get("/detail_text", { params: { id } });

//获取首页 天下酒鬼
export const getJiuGui = () => request.get("/home_1");

// 获取书籍详情

export const getBookDetail = (id: number) =>
  request.get("/book", { params: { id } });

// 获取作者详情
export const getAuthorDetail = (id: number) =>
  request.get("/author", { params: { id } });

//获取期刊首页数据
export const getPeriodicalList = () => request.get("/periodical");

//获取期刊分期列表页

export const getPeriodicalstage = (id: number) =>
  request.get("/author", { params: { id } });

// //获取页面全部点击页面数据
// export const getYouth = () => request.get("/ebook_list")

// 获取书架数据

export const getShelfList = () => request.get("/book_shelf");

//删除书籍
export const delShelfbook = (id: number) => request.delete("/book_shelf/" + id);

// 获取评论
// export const getCommentList = () => request.get("/comment");

//获取书库页面
export const getBook = (tab: any) => request.get("/book", { params: { tab } });

//获取搜索书

export const SBook = () => request.get("/book", {});

//查询
export const SearchBook = (name: any) => request.get(`/book?q=${name} `);

// 获取每本书的评论
export const getBookComment = (book_id: any) =>
  request.get("/comment/?book_id=" + book_id);

// 点赞

export const upAction = (id: any, up: any, uped: any) =>
  request.patch("/comment/" + id, { up, uped });

//获取我的评论
export const getCommentList = () => request.get("/comment");

//编辑用户名
export const Sbianji = (id: any, username: any) =>
  request.patch("/user/" + id, username);
